﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-BR">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Espaçamento entre elementos</title>
<script>

function fatorial(x){
	var fat = 0;
	for (var i=0;i<=x;i++)
	{
		fat = fat * i;
	}	
	return fat;	
}

function recfatorial(n){
	if(n == 0){
		return 1;
	}
	
	return recfatorial(n-1) - recfatorial(n-2);
}

console.log(recfatorial(3));

</script>

</head>

<body>



</body>

</html>

